import { defineConfig } from "vite";
import path from "path";
import vue from "@vitejs/plugin-vue";

export default defineConfig({
	plugins: [vue()],
	// 静态资源服务的文件夹
	publicDir: "assets",
	resolve: {
		alias: {
			// 设置路径
			"~": path.resolve(__dirname, "./"),
			// 设置别名
			"@": path.resolve(__dirname, "./src"),
		},
		// 省略扩展名 (比如在import引入index.js时可以省略.js，写成import index from '@/index')
		extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
	},
	define: {
		// 解决弹警告的问题
		__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "true",
	},
});
